﻿using DotNetty.Buffers;
using QQ.Client;
using System.Collections.Generic;

namespace QQ.Packet.Request.TLV
{
    public class TLV0x116 : IRequest
    {
        private readonly QQDeviceConfig config;
        private List<long> appIdList { get; set; } = new List<long> { 1600000226L };
        private byte ver { get; set; } = 0;
        public TLV0x116(QQDeviceConfig config)
        {
            this.config = config;
        }
        public IByteBuffer Serialize()
        {
            IByteBuffer ret = Unpooled.Buffer()
                .WriteByte(ver)
                .WriteInt(config.miscBitMap) // 184024956
                .WriteInt(config.subSigMap) // 66560
                .WriteByte(appIdList.Count);
            foreach (var item in appIdList) ret.WriteInt((int)item);
            return ret;
        }
    }
}